home *** CD-ROM | disk | FTP | other *** search
/ Acorn RISC PD-CD 1 / Acorn RISC PD-CD 1.iso / utilities / powerbase / pbasedoc / _tutorial < prev    next >
Encoding:
Text File  |  1993-05-22  |  24.0 KB  |  460 lines

  1.                                 Tutorial
  2.                                 ========
  3.  
  4. This document is intended to acquaint the new user as painlessly as possible
  5. with the most commonly-used facilities of Powerbase. It does not explain how
  6. to create a database from scratch (the file 'Create' does that) but it does
  7. explain how to:-
  8.  
  9.         (a) Start up Powerbase and open an existing database.
  10.         (b) Browse through the database and search for individual records.
  11.         (d) Add new records and alter or delete existing ones.
  12.         (d) Query the database to create simple reports.
  13.         (e) Close the database.
  14.  
  15. The supplied sample database 'Elements' is used to illustrate most of these
  16. activities. If you have a hard disc you should copy 'Elements' and Powerbase
  17. itself onto it before proceeding further. It is possible to use Powerbase
  18. using floppy discs only but some operations, such as creating reports, will
  19. be quite slow. Unless memory is very tight therefore, users of floppy discs
  20. are recommended to allocate at least 112K to the RAM disc and copy
  21. 'Elements' onto it. Everything will then run much faster. Powerbase can
  22. provide context-sensitive help via Acorn's !Help application and you are
  23. advised to load this, resizing the help window and placing it at the top
  24. right of the screen. Further help can be had by choosing the Help entry on
  25. Powerbase's main menu or on the icon-bar menu.
  26.  
  27. Starting Powerbase
  28. ==================
  29. Double-click on the Powerbase icon. After a few seconds it will appear on
  30. the icon-bar with the words "No data" beneath it to show that no database is
  31. open. Dragging the 'Elements' icon onto the Powerbase icon on the icon-bar
  32. will open 'Elements' for use and the words "No data" will be replaced by the
  33. name of the database. Double-clicking on the 'Elements' icon has the same
  34. effect, in fact if Powerbase isn't already on the icon-bar a double-click on
  35. 'Elements' will install it for you provided that the Powerbase icon has been
  36. seen by the filer. 
  37.  
  38. Two windows will open. One is the RECORD WINDOW and displays the first
  39. record in the database. The other is the KEYPAD which allows you to control
  40. the browsing, searching and editing functions of Powerbase. The keypad is
  41. rather large and obscures quite a big area of the record window. The
  42. most-used buttons, however, are on the top two rows and the keypad can be
  43. moved part way off screen to get it out of the way.
  44.  
  45. Browsing through the Records
  46. ============================
  47. The top row of buttons on the keypad allows you to browse through the file.
  48. If you have !Help running, as previously suggested, it will tell you what
  49. each button does. Once you get the general idea you will find the symbols on
  50. the buttons logical and self-explanatory. The most commonly used ones act as
  51. follows:
  52.  
  53.  * Single arrows move you one record at a time. From ACTINIUM, clicking the
  54.    right arrow takes you to ALUMINIUM. The left arrow takes you back to
  55.    ACTINIUM.
  56.  
  57.  * Double arrows move you through the file by long hops. Thus the right
  58.    double arrow takes you from ACTINIUM to BISMUTH and the left one back to
  59.    ACTINIUM again. The "fast forward/rewind" value is shown in the little
  60.    box between the "fast wind" buttons. It is initially set to 10 records
  61.    but can be altered by  clicking in it with SELECT and entering a new
  62.    value.
  63.  
  64.  * The buttons at the far left and right take you to the beginning and end of
  65.    the file. The rightmost button therefore takes you to ZIRCONIUM and the
  66.    leftmost one to ACTINIUM.
  67.  
  68. One further feature of these buttons should be noted; the file wraps around. 
  69. If you are at the last record (ZIRCONIUM) one record "forward" takes you to
  70. ACTINIUM again. Similarly, one record "back" from ACTINIUM gives ZIRCONIUM.
  71.  
  72. The second row has buttons marked like the 'play' and 'stop' controls of a
  73. cassette player. 'Play' allows an automatic 'flip-through' of the records
  74. without the need to touch any other buttons. When you get to the place you
  75. want, click on 'stop'. If the records go past too quickly you can slow the
  76. process down by increasing the number in the central icon of the top row of
  77. buttons. (This is normally used to set the 'fast-wind' interval; see above.)
  78.  
  79. Key fields, Keys and Indices
  80. ============================
  81. When using the six buttons on the top row of the keypad you will have 
  82. noticed that the records appear to be arranged alphabetically by the name of
  83. the element. The actual order in which records occur in the file is in fact
  84. nothing like alphabetical, but the order in which they are ACCESSED is
  85. determined by an INDEX which forces them to appear in alphabetical order.
  86. Every database must have at least one index, but you can have as many extra
  87. ones as you wish (subject to memory and disc limitations).
  88.                            
  89. Changing index
  90. --------------
  91. The second row of the keypad has two buttons featuring a blue arrow with a
  92. key symbol. Click on the right one and the record for HYDROGEN is displayed!
  93. If you now experiment with the top row of buttons as before you will find
  94. that the records no longer appear in alphabetical order of name but in order
  95. of ATOMIC NUMBER instead. What we have done is change to a different index.
  96. If a database has multiple indices the "key" buttons allow you to cycle
  97. through them in opposite directions. (Since Elements has only two indices
  98. the two buttons have exactly the same effect.) When you change to a
  99. different index the screen always displays the first record as determined by
  100. that index.
  101.  
  102. Keys and key fields
  103. -------------------
  104. An index is built from KEYS which are derived from a particular KEY FIELD.
  105. The two indices used by Elements are based on the NAME and ATOMIC NUMBER
  106. fields. The way in which the key stored in the index is derived from the key
  107. field is different in the two cases. For the NAME index the first four
  108. letters of the name are used. Since no two elements have names beginning
  109. with the same four letters this gives a unique "value" for the key. (Two
  110. letters would not have been enough because of such names as CHLORINE and
  111. CHROMIUM.) The ATOMIC NUMBER index is based on the whole 3-digit maximum
  112. length and the ordering is NUMERIC. Whenever a record is displayed the key
  113. is shown in the window title (# characters are for padding and should be
  114. ignored.)
  115.  
  116. The record screen clearly shows which fields are keyfields and which are
  117. not. The descriptors, or labels, of fields are normally black. Where the
  118. fields are keyfields they are shown in dark blue instead and the field used
  119. by the current index has its descriptor in red. Note also that the
  120. background colour of the NAME field is pale yellow whereas the rest are
  121. white . This indicates that NAME is the PRIMARY KEY field. The primary key
  122. and the index based on it is more important than the others. It is the one
  123. index which a database MUST have and is the one selected when a database is
  124. first opened.
  125.  
  126. Searching for a record
  127. ======================
  128. The rightmost button on the third row of the keypad shows a question mark
  129. followed by a "record card" icon  We will call it the Search button.
  130. When clicked with SELECT the keypad window grows an extension on the
  131. right-hand side. This new area contains a writable icon in which to enter
  132. the key of the record you wish to display. Suppose you want to see the
  133. record for the element NITROGEN. If the current index is the NAME then type
  134. in NITR and either type RETURN or click the 'OK' button. The required record
  135. quickly appears. If you enter the key of a non-existent record an error box
  136. is displayed. You don't necessarily need to type the whole key; NIT would do
  137. in this case, but NI would be ambiguous (there are elements called NICKEL
  138. and NIOBIUM).
  139.  
  140. To find NITROGEN when the ATOMIC NUMBER index is active you would need to
  141. know that the atomic number of nitrogen is 7. Type this in and type RETURN
  142. or click on 'OK' and the record appears. Abbreviated keys are NOT allowed in
  143. this case for obvious reasons; if you want element 103 (LAWRENCIUM) it's no
  144. good entering 10 (NEON)!
  145.  
  146. Editing the Database
  147. ====================
  148. This part of the tutorial involves changes to the data records. Make a
  149. working copy of the disc and put the original in a safe place. If you are
  150. using a copy of Elements on the RAM disc then the floppy disc won't be
  151. altered, but it's still not a good idea to work with the original disc.
  152.  
  153. Modifying records
  154. -----------------
  155. Pointing the mouse at any field and clicking SELECT places the caret in that
  156. field. The contents of the field may then be edited in the standard way for
  157. RISC OS writable icons. i.e.
  158.  
  159.        CTRL U clears the field.
  160.        DELETE removes the character to the left of the caret.
  161.        COPY removes the character to the right of the caret.
  162.        SHIFT/COPY deletes the word to the right of the caret.
  163.        CTRL/COPY deletes everything from the caret to the end of the line.
  164.        ⇦ and ⇨ move the caret left/right by one character.
  165.        SHIFT ⇦ and SHIFT ⇨ move the caret left/right by one word.
  166.        CRTL ⇦ and CTRL ⇨ move the caret to start and end of the field.
  167.           
  168. Changes made to a record cause the record to be written back to the database
  169. whenever you display a different record or close the database. There is a
  170. button on the keypad called 'Force update' but you don't normally need to
  171. use it.
  172.  
  173. At the ends of the third row of keypad buttons are two which contain a 
  174. vertical blue arrow. Clicking on the left button stores the contents of the
  175. field which has the caret in a scratchpad. Moving the caret to another
  176. field and clicking the right button copies the data from the scratchpad
  177. into that field, over-writing its previous contents. This provides a quick
  178. method of copying data from one field to another, or from one record to
  179. another. You may continue to "paste" the data into new fields as often as
  180. you like. Only when you click the left button again are the contents of the
  181. scratchpad changed. Data "pasted" into a field cannot "overflow"; if too
  182. long for the field it will be cut to the permitted length. As an added
  183. precaution you can't "paste" a null string into a field.
  184.  
  185. Recovering data after a mistake
  186. -------------------------------
  187. You will sometimes edit the wrong field by mistake and want to restore the
  188. previous contents. Click MENU over the field. The second entry on the main
  189. menu contains the "tag" of the field. Follow the right-pointing arrow to the
  190. 'Field' sub-menu and choose the last entry: 'Restore field'. Similarly, if
  191. you make a mess of a complete record and want to go back to the way it was
  192. you can choose 'Restore record' from the main menu.
  193.  
  194. It is important to realise that these 'restore' facilities will not work if
  195. you have looked at another record before using them (or clicked on 'Force
  196. update'). In other words you can recover data which has been altered in or
  197. removed from the currently-displayed record only.
  198.  
  199. Adding new records
  200. ------------------
  201. First we will add a new record for a fictitious element as described below:-
  202.  
  203.                    NAME             TASMANIUM
  204.                    SYMBOL           Ts
  205.                    ATOMIC NUMBER    108
  206.  
  207. We could invent a lot more, but this will be enough to get the idea across.
  208.  
  209. At the far left of the second row on the keypad is a button with a plus sign
  210. and a "record card" icon. This is the 'Insert' button. A blank record will
  211. be displayed with the caret in the NAME field.  Enter TASMANIUM here and
  212. press RETURN. The caret will jump to the SYMBOL field. Enter Ts. You will
  213. now need to press RETURN twice to get to ATOMIC NUMBER (One press takes you
  214. to the un-named field after NAME where the origin of the element's name is
  215. given.) Alternatively you could point the mouse at the ATOMIC NUMBER box and
  216. click SELECT. There is no need to press RETURN after entering a field in
  217. order to "accept" the data; it's simply the most convenient way of getting
  218. to the next field if that's what you want to do.  When entering data into
  219. widely- scattered fields it is more convenient to use the mouse.
  220.  
  221. Having entered your data click any of the first row of buttons so that a
  222. different record is displayed. Now use 'Search' to find TASMANIUM by name.
  223. Change to the other index  and find it by atomic number. In both cases try 
  224. moving to the record just before and just after the new one, noting that it
  225. has been placed in its correct position in both indices: between TANTALUM
  226. and TECHNETIUM in the NAME index and at the very end of the ATOMIC NUMBER
  227. index.
  228.  
  229. Data Input Validation
  230. ---------------------
  231. When entering the above data you may have noticed that the NAME field will
  232. only accept capital letters and the ATOMIC NUMBER field will only accept
  233. numerals. This is because the fields have an associated TYPE which restricts
  234. the characters which the field will accept. Any others are simply ignored.
  235. We will call this feature TYPE VALIDATION. 
  236.  
  237. Another level of data validation, which we will now illustrate, is called
  238. TABLE VALIDATION  Make an entry in the GROUP field. Type X, for example,
  239. then try to move to another field by either pressing RETURN or clicking the
  240. mouse.  You'll find that you can't do so - you get an error message instead.
  241. This is because the GROUP field is linked to a VALIDATION TABLE which
  242. means that only entries which appear in the table may be used in that field.
  243. Fields linked to validation tables are distinguished by using dark green, 
  244. instead of black, as the foreground colour.
  245.  
  246. To see what the validation table contains, place the caret in the GROUP
  247. field then click on the List values button on the keypad. The validation
  248. table will then be displayed in its own window. Only those items in the left
  249. column of the table may be entered in the GROUP field. Element 108 would be
  250. a transition metal, so enter T. You will now find that Powerbase accepts
  251. your data.
  252.  
  253. Both type validation and table validation may be turned off and on by means
  254. of an option on the Validation submenu. The item is normally ticked, showing
  255. that validation is turned on.
  256.  
  257. Deleting records
  258. ----------------
  259. Since "tasmanium" isn't a real element we want to remove it from our
  260. database.  There is a "dustbin" button  which will do just that: but don't
  261. use it yet.   Make sure that the unwanted record is on the screen and click
  262. the button to the RIGHT of the bin. You will now find that "tasmanium" has
  263. vanished; the names run straight from TANTALUM to TECHNETIUM and the atomic
  264. numbers end with 103, just as they did before you added the extra record.
  265.  
  266. Wasn't that rather TOO easy? Suppose you clicked the button by mistake and
  267. deleted an important record! Powerbase handles this very nicely. The record
  268. hasn't really been deleted at all. To prove this, click the button above the
  269. one you used for "deleting". The button shows a green right-pointing arrow
  270. and a "card index" icon. There's TASMANIUM again! You will soon find that it
  271. appears to be the ONLY record in the file! Don't worry; nothing has been
  272. lost.  A Powerbase database is treated as six separate SUBFILES 
  273. numbered 0-5. When you first open the database you are looking at Subfile 0
  274. and the heading of the record window shows this. If you look at the heading
  275. now you will see that it has changed to Subfile 1.
  276.  
  277. The buttons on either side of the bin carry pictures which suggest their
  278. true functions. They do NOT delete records; they merely MOVE records from
  279. one subfile to another. The right button moves the displayed record to the
  280. next subfile in sequence. Thus, in the above case the TASMANIUM record has
  281. been moved from subfile 0 to subfile 1. A record in subfile 1 would be moved
  282. to subfile 2 and so on.  What happens when it gets to 5? The next click
  283. shoves it into subfile 0 where it was originally. As you might have guessed,
  284. the left button moves records in the opposite direction, i.e. from subfile 1
  285. to 0 or from subfile 0 to 5.
  286.  
  287. What happens when you DO want to lose a record for good?  That's when you
  288. consign it to the dustbin!  Since this button's action is more drastic than
  289. that of the other two you are asked for confirmation before deletion occurs.
  290.  
  291. Printing Lists
  292. ==============
  293. Before Powerbase can produce a list it must be told:
  294.  
  295.            * which FIELDS should appear on the list
  296.            * which RECORDS should appear on the list.
  297.  
  298. Making the field selection
  299. --------------------------
  300. Specifying the fields you want is extremely easy. To include a field simply
  301. point the mouse at it and click with ADJUST. The selected field will then
  302. appear in inverse video (i.e. normally white on black). If you change your
  303. mind about a field you can de-select it by clicking on it again with ADJUST.
  304. The order in which the fields will appear in the printed list is the order
  305. in which you select them. Take care with this since there is nothing on the
  306. screen to indicate what order the fields will be in.  The fields chosen for
  307. inclusion in a printout make up a SELECTION  which may be saved and reloaded
  308. for future use. Just for now select NAME, SYMBOL and GROUP.
  309.  
  310. Choosing which records to print
  311. -------------------------------
  312. Specifying which records to print is somewhat more complex, although efforts
  313. have been made to render it as simple as possible. With the mouse pointer in
  314. the record window click MENU. This displays the main Powerbase menu from
  315. which you should choose Print.  A small window appears in which you can
  316. specify the criteria which must be met by records for inclusion in the list.
  317. If you just click OK (or press RETURN) without entering anything here you
  318. will obtain a list of the whole database (or, more accurately, of the the
  319. whole of the current subfile ). Try this first.
  320.  
  321. Nothing will be printed until the search is complete. If the mouse pointer
  322. is over the main window the hourglass will tell you how far things have
  323. progressed. Pressing Escape causes the process to be aborted. When the
  324. process is complete the list will be displayed in a window. It may be saved
  325. as a text file and printed using the usual RISC OS drivers .
  326.  
  327. If you point to a record in the displayed list and double-click with SELECT
  328. Powerbase will display the chosen record in the main record window. Note
  329. that the caret is placed in the field you were pointing to on the list. This
  330. is very useful if you spot errors in the data whilst examining a list. A
  331. double click on the offending item offers the record with the caret
  332. correctly positioned for editing.
  333.  
  334. Most database queries, however, don't involve printing all the records! You
  335. will usually need to enter a SEARCH FORMULA before clicking OK. Search
  336. formulae can be quite complex and a more detailed treatment is given in a
  337. later section. Only a couple of simple examples will be shown here.                  
  338. Suppose we want a list of all the transitional elements. i.e. all those
  339. which have T in the GROUP field. We can do this by entering the search
  340. formula GP=T.  Why GP?  Shouldn't it be GROUP=T?  The latter seems more
  341. obvious, but what happens if the field has no descriptor? The record screen
  342. of !Elements contains many such fields such as the one on the first line 
  343. which gives the origin of the element's name.  Every field which can hold
  344. data has to have a "handle" by which we can refer to it and that handle is
  345. called the field TAG. Tags are very short; never more than four characters.
  346. You have seen some tags already. Look at the list you printed earlier.  The
  347. three columns are headed NAME, SYM and GP not NAME, SYMBOL and GROUP. The
  348. user therefore meets tags in two contexts:
  349.  
  350.            *  They are used to specify fields in search formulae
  351.            *  They are the default column headings in lists.
  352.  
  353. The Print options window  allows you to change the column headings to the
  354. field descriptors if you so wish.
  355.  
  356. Type GP=T in the space provided and click OK. This time the list will be a
  357. much shorter one and you will see that the GP column contains T in every
  358. case. 
  359.  
  360. Our second example involves printing all elements whose names end in "IUM".
  361. What we need to specify is that "NAME contains IUM" and we do this by
  362. entering the search formula NAME{IUM. Finally we will combine the previous
  363. two examples into  a two-pronged search for all the TRANSITIONAL elements
  364. whose names end in "IUM". The search formula this time is NAME{IUM AND GP=T.
  365. Note the spaces before and after AND.  These are essential.  You might like
  366. to try an alternative way of entering this search formula. Proceed as
  367. follows:
  368.  
  369.         * Click the "toggle size" icon of the matching records window. This
  370.           makes it expand to show more controls.
  371.         * NAME should already be visible as the required field, but you need
  372.           to select the radio button for Contains.
  373.         * Click in the space next to Value: and enter IUM.
  374.         * Click the AND button to select it.
  375.         * Click Add to formula.
  376.  
  377.           The search formula should now read NAME{IUM AND.
  378.  
  379.         * Click on the field tag (currently NAME) until it reads GP
  380.         * Select Is equal to.
  381.         * Enter T in the Value field.
  382.         * Click Add to formula.
  383.  
  384. The complete search formula should now be visible so click OK and the list
  385. will be produced. The above takes far longer to describe than it does to do
  386. and can be a great help to the infrequent Powerbase user who has trouble
  387. remembering the syntax of search formulae. If you use certain complex
  388. queries often you may find it convenient to save them for future use .
  389.  
  390. The biggest problem you are likely to encounter is not knowing the tags for
  391. the various fields. The method just described gets round the problem by
  392. letting you cycle through the tags by clicking on an icon rather than typing
  393. them directly. You will also find that clicking with SELECT on a field while
  394. holding down ALT causes the tag of that field to appear in the search
  395. formula icon.
  396.  
  397. Closing down
  398. ============
  399. A database may be closed down by choosing the Close database entry from the
  400. icon bar menu. When you do so, all the indices  stored in memory are saved
  401. to disc (the Save indices button on the keypad gives a clear indication of
  402. this) and the database is closed. You do not have to do anything to save the
  403. database itself to disc since it has been there all along. Only the current
  404. record is in memory at any one time and this is automatically written back
  405. to disc when it has been changed in any way.
  406.  
  407. Also saved automatically is the link file which holds the relational links
  408. between the main database and the validation tables. The tables themselves
  409. are NOT saved automatically. If you have edited a table, or created a new
  410. one, you will need to click MENU over the displayed table and choose the
  411. Save option from it.
  412.  
  413. If you are going to use another database straight away just double click on
  414. it or drag it to the Powerbase icon on the icon bar. In fact you don't even
  415. need to close the previous database before doing this; Powerbase will do it
  416. for you.
  417.  
  418. When working with a database on the RAM disc Powerbase will issue a warning
  419. that the data is not secure and that you need to drag it from the RAM disc
  420. to a floppy or hard disc before switching off.
  421.  
  422. To terminate Powerbase itself use the Quit option on the icon bar menu.
  423.  
  424. Merging data into an Impression document
  425. ========================================
  426. The distribution disc contains a simple Impression document called
  427. 'MergeTest'. It will be used in conjunction with the 'Elements' database to
  428. illustrate direct data-merging with Impression. 
  429.  
  430. (1) Make sure that Impression has been "seen" by the filer. (You need not
  431.     actually load it.)
  432.  
  433. (2) Open the 'Elements' database and drop 'MergeTest' onto the record
  434.     window.
  435.  
  436. (3) Click on 'Merge' in the 'Merge data' dialogue box. You will see that
  437.     data relating to the record for ACTINIUM has been inserted into the
  438.     Impression document.
  439.  
  440. (4) The arrow and double-arrow buttons (identical to those on the keypad)
  441.     may be used to move through the database causing different records to be
  442.     merged into the document.
  443.  
  444. (5) A search formula may be used to restrict the operation to records
  445.     matching certain criteria.
  446.  
  447. (6) 'Print' may be used to print the document with the currently-merged
  448.      data. To print a set of documents, one for each matching element,
  449.      select the 'Print all' switch then click on 'Merge'.
  450.  
  451. During data-merging Impression editing is disabled - you can't place the
  452. caret in the document and the mouse pointer appears as a red and blue cross.
  453. Clicking on 'Cancel' or closing the 'Merge data' dialogue box restores
  454. normal editing.
  455.  
  456. For more information on data-merging, including instructions on how to
  457. prepare the Impression document, see 'MailMerge'.
  458.  
  459.  
  460.